﻿using System;

namespace Isaac.Joy.Identity.Module
{
    public class User
    {
        /// <summary>
        /// 用户编号
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 登陆账号
        /// </summary>
        public string Account { get; set; }

        /// <summary>
        /// 登陆密码（加密后）
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// 用户昵称
        /// </summary>
        public string NickName { get; set; }

        /// <summary>
        /// 生日
        /// </summary>
        private DateTime? _birthday;
        public DateTime? Birthday {
            get
            {
                return _birthday == CreateTime ? null : _birthday;
            }
            set { _birthday = value; }
        }

        /// <summary>
        /// 手机号码
        /// </summary>
        public string Mobile { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        public string Tel { get; set; }

        /// <summary>
        /// QQ号码
        /// </summary>
        public string QQ { get; set; }

        /// <summary>
        /// 通讯地址
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public Gender Gender { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 是否被删除
        /// </summary>
        public int IsDelete { get; set; }

        /// <summary>
        /// 用户角色
        /// </summary>
        public Role Role { get; set; }
    }
}
